<?php
include_once( 'saetv2.ex.class.php' );

class Trendline {

	var $client;
    	var $friends;
	var $trends;
	var $user;
	var $friendAndHisTrends;
	var $trendPaticipators;
	var $isLogin;

	function __construct( $client, $user) {
		$this->client = $client;
		$this->user = $user;
		$this->friends = $this->getFriends($user->id,1);
		
	}

// ---<friends>-------------------
	function getFriends($uid, $page) {
		if($uid == NULL){
			$uid = $this->user->id;
		}
		$part = $this->client->bilateral($uid, $page);
		if (count($part)==0) {
			return null;
		} elseif (count($part) < 50) {
			return $part;
		} else {
			$page=$page+1;
			$list=getFriends($uid, $page);
			return array_merge($list, $part);
		}		
	}

	

}

?>